<?php

namespace STAGE\StageBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Societe
 *
 * @ORM\Table()
 * @ORM\Entity(repositoryClass="STAGE\StageBundle\Entity\SocieteRepository")
 */
class Societe {

    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var string
     *
     * @ORM\Column(name="nom", type="string", length=255)
     */
    private $nom;

    /**
     * @var integer
     *
     * @ORM\Column(name="tel_fixe", type="integer")
     */
    private $telFixe;

    /**
     * @var integer
     *
     * @ORM\Column(name="tel_fax", type="integer")
     */
    private $telFax;

    /**
     * @var string
     *
     * @ORM\Column(name="department", type="string", length=255)
     */
    private $department;

    /**
     * @var string
     *
     * @ORM\Column(name="adresse", type="string", length=255)
     */
    private $adresse;

    /**
     *
     * @ORM\OneToMany(targetEntity="STAGE\UserBundle\Entity\User",mappedBy="societe",cascade={"persist"})
     */
    private $encadreurs;

    /**
     * Get id
     *
     * @return integer 
     */
    public function getId() {
        return $this->id;
    }

    /**
     * Set nom
     *
     * @param string $nom
     * @return Societe
     */
    public function setNom($nom) {
        $this->nom = $nom;

        return $this;
    }

    /**
     * Get nom
     *
     * @return string 
     */
    public function getNom() {
        return $this->nom;
    }

    /**
     * Set telFixe
     *
     * @param integer $telFixe
     * @return Societe
     */
    public function setTelFixe($telFixe) {
        $this->telFixe = $telFixe;

        return $this;
    }

    /**
     * Get telFixe
     *
     * @return integer 
     */
    public function getTelFixe() {
        return $this->telFixe;
    }

    /**
     * Set telFax
     *
     * @param integer $telFax
     * @return Societe
     */
    public function setTelFax($telFax) {
        $this->telFax = $telFax;

        return $this;
    }

    /**
     * Get telFax
     *
     * @return integer 
     */
    public function getTelFax() {
        return $this->telFax;
    }

    /**
     * Set department
     *
     * @param string $department
     * @return Societe
     */
    public function setDepartment($department) {
        $this->department = $department;

        return $this;
    }

    /**
     * Get department
     *
     * @return string 
     */
    public function getDepartment() {
        return $this->department;
    }

    /**
     * Set adresse
     *
     * @param string $adresse
     * @return Societe
     */
    public function setAdresse($adresse) {
        $this->adresse = $adresse;

        return $this;
    }

    /**
     * Get adresse
     *
     * @return string 
     */
    public function getAdresse() {
        return $this->adresse;
    }

    /**
     * Constructor
     */
    public function __construct()
    {
        $this->encadreurs = new \Doctrine\Common\Collections\ArrayCollection();
    }

    /**
     * Add encadreurs
     *
     * @param \STAGE\UserBundle\Entity\User $encadreurs
     * @return Societe
     */
    public function addEncadreur(\STAGE\UserBundle\Entity\User $encadreurs)
    {
        $this->encadreurs[] = $encadreurs;
        $encadreurs->setSociete($this);
        $encadreurs->addRole('ROLE_ENCADREUR');
        $encadreurs->setEnabled(true);
       
        return $this;
    }

    /**
     * Remove encadreurs
     *
     * @param \STAGE\UserBundle\Entity\User $encadreurs
     */
    public function removeEncadreur(\STAGE\UserBundle\Entity\User $encadreurs)
    {
        $this->encadreurs->removeElement($encadreurs);
    }

    /**
     * Get encadreurs
     *
     * @return \Doctrine\Common\Collections\Collection 
     */
    public function getEncadreurs()
    {
        return $this->encadreurs;
    }
}
